<?php

/**
 * Description of Mapper
 *
 * @author Allan
 */
class App_Model_Mapper {

    protected $dbTable;

    public function getDbTable() {
        if(null === $this->dbTable){
            $this->setDbTable($this->dbTableName);
        }
        return $this->dbTable;
    }

    public function setDbTable($dbTable) {
        if(is_string($dbTable)){
            $dbTable = new $dbTable();
        }
        if(!$dbTable instanceof Zend_Db_Table_Abstract){
            throw new Exception('Invalid table data gateway provided');
        }
        $this->dbTable = $dbTable;
        return $this;
    }
}

